package com.shijingshan.fahaisi;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Date;

@Component
public class FahaisiSchedule {

    ///@Scheduled(cron = "0 0/10 6 * * *")
    //@Scheduled(cron = "0 0/1 * * * *")
    //@Scheduled(cron = "0 0-10 6 * * *")
    public void query(){

        JSONObject result = FahaisiHttp.get();
        System.out.println(new Date());
        System.out.println(result);
    }

    //@PostConstruct
    public void init() {
        JSONObject result = FahaisiHttp.get();
        System.out.println(new Date());
        System.out.println(result);
    }

}
